package _25_visitor_pattern.v_common;

import java.util.Random;

/**
 * @Description: 结构对象
 * @Auther: 2019/6/30 9:35 by zhang.jy
 */
public class ObjectStruture {
	//对象生成器，这里通过一个工厂方法模式模拟
	public static Element createElement() {
		Random rand = new Random();
		if (rand.nextInt(100) > 50) {
			return new ConcreteElement1();
		} else {
			return new ConcreteElement2();
		}
	}
}